home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / src / make-3.69 / configur < prev    next >
Encoding:
Text File  |  1993-11-07  |  57.0 KB  |  2,284 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  23. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  24.  
  25. for arg
  26. do
  27.   # Handle --exec-prefix with a space before the argument.
  28.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  29.   # Handle --host with a space before the argument.
  30.   elif test x$next_host = xyes; then next_host=
  31.   # Handle --prefix with a space before the argument.
  32.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  33.   # Handle --srcdir with a space before the argument.
  34.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  35.   else
  36.     case $arg in
  37.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  38.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  52.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  53.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  54.     next_prefix=yes ;;
  55.  
  56.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  57.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  59.     next_srcdir=yes ;;
  60.  
  61.      -with-* | --with-*)
  62.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  63.        # Reject names that aren't valid shell variable names.
  64.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  65.          echo "configure: $package: invalid package name" >&2; exit 1
  66.        fi
  67.        package=`echo $package| sed 's/-/_/g'`
  68.        case "$arg" in
  69.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  70.          *) val=1 ;;
  71.        esac
  72.        eval "with_$package='$val'" ;;
  73.  
  74.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  75.        verbose=yes ;;
  76.  
  77.      *) ;;
  78.     esac
  79.   fi
  80. done
  81.  
  82. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  83. trap 'rm -f confdefs*' 0
  84.  
  85. # NLS nuisances.
  86. # These must not be set unconditionally because not all systems understand
  87. # e.g. LANG=C (notably SCO).
  88. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  89. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  90.  
  91. rm -f conftest* confdefs.h
  92. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  93. echo > confdefs.h
  94. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  95.  
  96. # A filename unique to this package, relative to the directory that
  97. # configure is in, which we can look for to find out if srcdir is correct.
  98. unique_file=vpath.c
  99.  
  100. # Find the source files, if location was not specified.
  101. if test -z "$srcdir"; then
  102.   srcdirdefaulted=yes
  103.   # Try the directory containing this script, then `..'.
  104.   prog=$0
  105.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  106.   test "X$confdir" = "X$prog" && confdir=.
  107.   srcdir=$confdir
  108.   if test ! -r $srcdir/$unique_file; then
  109.     srcdir=..
  110.   fi
  111. fi
  112. if test ! -r $srcdir/$unique_file; then
  113.   if test x$srcdirdefaulted = xyes; then
  114.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  115.   else
  116.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  117.   fi
  118.   exit 1
  119. fi
  120. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  121. # But we can't avoid them for `..', to make subdirectories work.
  122. case $srcdir in
  123.   .|/*|~*) ;;
  124.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  125. esac
  126.  
  127.  
  128. # Save the original args to write them into config.status later.
  129. configure_args="$*"
  130.         
  131.  
  132. # We want these before the checks, so the checks can modify their values.
  133. test -z "$CFLAGS" && CFLAGS=-g 
  134. test -z "$LDFLAGS" && LDFLAGS=-g 
  135.  
  136. if test -z "$CC"; then
  137.   # Extract the first word of `gcc', so it can be a program name with args.
  138.   set dummy gcc; word=$2
  139.   echo checking for $word
  140.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  141.   for dir in $PATH; do
  142.     test -z "$dir" && dir=.
  143.     if test -f $dir/$word; then
  144.       CC="gcc"
  145.       break
  146.     fi
  147.   done
  148.   IFS="$saveifs"
  149. fi
  150. test -z "$CC" && CC="cc"
  151. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  152.  
  153. # Find out if we are using GNU C, under whatever name.
  154. cat > conftest.c <<EOF
  155. #ifdef __GNUC__
  156.   yes
  157. #endif
  158. EOF
  159. ${CC-cc} -E conftest.c > conftest.out 2>&1
  160. if egrep yes conftest.out >/dev/null 2>&1; then
  161.   GCC=1 # For later tests.
  162. fi
  163. rm -f conftest*
  164.  
  165. # Make sure to not get the incompatible SysV /etc/install and
  166. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  167. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  168. # or the AFS install, which mishandles nonexistent args, or
  169. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  170. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  171. # anyway.  Sigh.
  172. if test "z${INSTALL}" = "z" ; then
  173.   echo checking for install
  174.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  175.   for dir in $PATH; do
  176.     test -z "$dir" && dir=.
  177.     case $dir in
  178.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  179.     *)
  180.       if test -f $dir/installbsd; then
  181.     INSTALL="$dir/installbsd -c" # OSF1
  182.     INSTALL_PROGRAM='$(INSTALL)'
  183.     INSTALL_DATA='$(INSTALL) -m 644'
  184.     break
  185.       fi
  186.       if test -f $dir/install; then
  187.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  188.       : # AIX
  189.     else
  190.       INSTALL="$dir/install -c"
  191.       INSTALL_PROGRAM='$(INSTALL)'
  192.       INSTALL_DATA='$(INSTALL) -m 644'
  193.       break
  194.     fi
  195.       fi
  196.       ;;
  197.     esac
  198.   done
  199.   IFS="$saveifs"
  200. fi
  201. INSTALL=${INSTALL-cp}
  202. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  203. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  204. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  205. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  206. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  207.  
  208. if test -z "$RANLIB"; then
  209.   # Extract the first word of `ranlib', so it can be a program name with args.
  210.   set dummy ranlib; word=$2
  211.   echo checking for $word
  212.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  213.   for dir in $PATH; do
  214.     test -z "$dir" && dir=.
  215.     if test -f $dir/$word; then
  216.       RANLIB="ranlib"
  217.       break
  218.     fi
  219.   done
  220.   IFS="$saveifs"
  221. fi
  222. test -z "$RANLIB" && RANLIB=":"
  223. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  224.  
  225. echo checking how to run the C preprocessor
  226. if test -z "$CPP"; then
  227.   # This must be in double quotes, not single quotes, because CPP may get
  228.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  229.   # make.  It must be expanded now.
  230.   CPP="${CC-cc} -E"
  231.   cat > conftest.c <<EOF
  232. #include "confdefs.h"
  233. #include <stdio.h>
  234. Syntax Error
  235. EOF
  236. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  237. if test -z "$err"; then
  238.   :
  239. else
  240.   rm -rf conftest*
  241.   CPP=/lib/cpp
  242. fi
  243. rm -f conftest*
  244. fi
  245. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  246.             echo checking for AIX
  247. cat > conftest.c <<EOF
  248. #include "confdefs.h"
  249. #ifdef _AIX
  250.   yes
  251. #endif
  252.  
  253. EOF
  254. eval "$CPP conftest.c > conftest.out 2>&1"
  255. if egrep "yes" conftest.out >/dev/null 2>&1; then
  256.   rm -rf conftest*
  257.   
  258. {
  259. test -n "$verbose" && \
  260. echo "    defining _ALL_SOURCE"
  261. echo "#define" _ALL_SOURCE 1 >> confdefs.h
  262. DEFS="$DEFS -D_ALL_SOURCE=1"
  263. SEDDEFS="${SEDDEFS}\${SEDdA}_ALL_SOURCE\${SEDdB}_ALL_SOURCE\${SEDdC}1\${SEDdD}
  264. \${SEDuA}_ALL_SOURCE\${SEDuB}_ALL_SOURCE\${SEDuC}1\${SEDuD}
  265. \${SEDeA}_ALL_SOURCE\${SEDeB}_ALL_SOURCE\${SEDeC}1\${SEDeD}
  266. "
  267. }
  268.  
  269.  
  270. fi
  271. rm -f conftest*
  272.  
  273.  
  274. echo checking for POSIXized ISC
  275. if test -d /etc/conf/kconfig.d &&
  276.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  277. then
  278.   ISC=1 # If later tests want to check for ISC.
  279.   
  280. {
  281. test -n "$verbose" && \
  282. echo "    defining _POSIX_SOURCE"
  283. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  284. DEFS="$DEFS -D_POSIX_SOURCE=1"
  285. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  286. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  287. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  288. "
  289. }
  290.  
  291.   if test -n "$GCC"; then
  292.     CC="$CC -posix"
  293.   else
  294.     CC="$CC -Xp"
  295.   fi
  296. fi
  297.  
  298. echo checking for minix/config.h
  299. cat > conftest.c <<EOF
  300. #include "confdefs.h"
  301. #include <minix/config.h>
  302. EOF
  303. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  304. if test -z "$err"; then
  305.   rm -rf conftest*
  306.   MINIX=1
  307.  
  308. fi
  309. rm -f conftest*
  310.  
  311. # The Minix shell can't assign to the same variable on the same line!
  312. if test -n "$MINIX"; then
  313.   
  314. {
  315. test -n "$verbose" && \
  316. echo "    defining _POSIX_SOURCE"
  317. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  318. DEFS="$DEFS -D_POSIX_SOURCE=1"
  319. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  320. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  321. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  322. "
  323. }
  324.  
  325.   
  326. {
  327. test -n "$verbose" && \
  328. echo "    defining" _POSIX_1_SOURCE to be 2
  329. echo "#define" _POSIX_1_SOURCE 2 >> confdefs.h
  330. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  331. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_1_SOURCE\${SEDdB}_POSIX_1_SOURCE\${SEDdC}2\${SEDdD}
  332. \${SEDuA}_POSIX_1_SOURCE\${SEDuB}_POSIX_1_SOURCE\${SEDuC}2\${SEDuD}
  333. \${SEDeA}_POSIX_1_SOURCE\${SEDeB}_POSIX_1_SOURCE\${SEDeC}2\${SEDeD}
  334. "
  335. }
  336.  
  337.   
  338. {
  339. test -n "$verbose" && \
  340. echo "    defining _MINIX"
  341. echo "#define" _MINIX 1 >> confdefs.h
  342. DEFS="$DEFS -D_MINIX=1"
  343. SEDDEFS="${SEDDEFS}\${SEDdA}_MINIX\${SEDdB}_MINIX\${SEDdC}1\${SEDdD}
  344. \${SEDuA}_MINIX\${SEDuB}_MINIX\${SEDuC}1\${SEDuD}
  345. \${SEDeA}_MINIX\${SEDeB}_MINIX\${SEDeC}1\${SEDeD}
  346. "
  347. }
  348.  
  349. fi
  350.  
  351. echo checking for ANSI C header files
  352. cat > conftest.c <<EOF
  353. #include "confdefs.h"
  354. #include <stdlib.h>
  355. #include <stdarg.h>
  356. #include <string.h>
  357. #include <float.h>
  358. EOF
  359. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  360. if test -z "$err"; then
  361.   rm -rf conftest*
  362.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  363. echo '#include "confdefs.h"
  364. #include <string.h>' > conftest.c
  365. eval "$CPP conftest.c > conftest.out 2>&1"
  366. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  367.   rm -rf conftest*
  368.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  369. cat > conftest.c <<EOF
  370. #include "confdefs.h"
  371. #include <ctype.h>
  372. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  373. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  374. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  375. int main () { int i; for (i = 0; i < 256; i++)
  376. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  377. exit (0); }
  378.  
  379. EOF
  380. eval $compile
  381. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  382.   
  383. {
  384. test -n "$verbose" && \
  385. echo "    defining STDC_HEADERS"
  386. echo "#define" STDC_HEADERS 1 >> confdefs.h
  387. DEFS="$DEFS -DSTDC_HEADERS=1"
  388. SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
  389. \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
  390. \${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
  391. "
  392. }
  393.  
  394.  
  395. fi
  396. rm -fr conftest*
  397.  
  398. fi
  399. rm -f conftest*
  400.  
  401.  
  402. fi
  403. rm -f conftest*
  404.  
  405. echo checking for directory library header
  406. dirheader=
  407. if test -z "$dirheader"; then
  408.   echo checking for dirent.h
  409. cat > conftest.c <<EOF
  410. #include "confdefs.h"
  411. #include <sys/types.h>
  412. #include <dirent.h>
  413. int main() { exit(0); }
  414. int t() { DIR *dirp = 0; }
  415. EOF
  416. if eval $compile; then
  417.   rm -rf conftest*
  418.   
  419. {
  420. test -n "$verbose" && \
  421. echo "    defining DIRENT"
  422. echo "#define" DIRENT 1 >> confdefs.h
  423. DEFS="$DEFS -DDIRENT=1"
  424. SEDDEFS="${SEDDEFS}\${SEDdA}DIRENT\${SEDdB}DIRENT\${SEDdC}1\${SEDdD}
  425. \${SEDuA}DIRENT\${SEDuB}DIRENT\${SEDuC}1\${SEDuD}
  426. \${SEDeA}DIRENT\${SEDeB}DIRENT\${SEDeC}1\${SEDeD}
  427. "
  428. }
  429.  dirheader=dirent.h
  430.  
  431. fi
  432. rm -f conftest*
  433. fi
  434. if test -z "$dirheader"; then
  435.   echo checking for sys/ndir.h
  436. cat > conftest.c <<EOF
  437. #include "confdefs.h"
  438. #include <sys/types.h>
  439. #include <sys/ndir.h>
  440. int main() { exit(0); }
  441. int t() { DIR *dirp = 0; }
  442. EOF
  443. if eval $compile; then
  444.   rm -rf conftest*
  445.   
  446. {
  447. test -n "$verbose" && \
  448. echo "    defining SYSNDIR"
  449. echo "#define" SYSNDIR 1 >> confdefs.h
  450. DEFS="$DEFS -DSYSNDIR=1"
  451. SEDDEFS="${SEDDEFS}\${SEDdA}SYSNDIR\${SEDdB}SYSNDIR\${SEDdC}1\${SEDdD}
  452. \${SEDuA}SYSNDIR\${SEDuB}SYSNDIR\${SEDuC}1\${SEDuD}
  453. \${SEDeA}SYSNDIR\${SEDeB}SYSNDIR\${SEDeC}1\${SEDeD}
  454. "
  455. }
  456.  dirheader=sys/ndir.h
  457.  
  458. fi
  459. rm -f conftest*
  460. fi
  461. if test -z "$dirheader"; then
  462.   echo checking for sys/dir.h
  463. cat > conftest.c <<EOF
  464. #include "confdefs.h"
  465. #include <sys/types.h>
  466. #include <sys/dir.h>
  467. int main() { exit(0); }
  468. int t() { DIR *dirp = 0; }
  469. EOF
  470. if eval $compile; then
  471.   rm -rf conftest*
  472.   
  473. {
  474. test -n "$verbose" && \
  475. echo "    defining SYSDIR"
  476. echo "#define" SYSDIR 1 >> confdefs.h
  477. DEFS="$DEFS -DSYSDIR=1"
  478. SEDDEFS="${SEDDEFS}\${SEDdA}SYSDIR\${SEDdB}SYSDIR\${SEDdC}1\${SEDdD}
  479. \${SEDuA}SYSDIR\${SEDuB}SYSDIR\${SEDuC}1\${SEDuD}
  480. \${SEDeA}SYSDIR\${SEDeB}SYSDIR\${SEDeC}1\${SEDeD}
  481. "
  482. }
  483.  dirheader=sys/dir.h
  484.  
  485. fi
  486. rm -f conftest*
  487. fi
  488. if test -z "$dirheader"; then
  489.   echo checking for ndir.h
  490. cat > conftest.c <<EOF
  491. #include "confdefs.h"
  492. #include <sys/types.h>
  493. #include <ndir.h>
  494. int main() { exit(0); }
  495. int t() { DIR *dirp = 0; }
  496. EOF
  497. if eval $compile; then
  498.   rm -rf conftest*
  499.   
  500. {
  501. test -n "$verbose" && \
  502. echo "    defining NDIR"
  503. echo "#define" NDIR 1 >> confdefs.h
  504. DEFS="$DEFS -DNDIR=1"
  505. SEDDEFS="${SEDDEFS}\${SEDdA}NDIR\${SEDdB}NDIR\${SEDdC}1\${SEDdD}
  506. \${SEDuA}NDIR\${SEDuB}NDIR\${SEDuC}1\${SEDuD}
  507. \${SEDeA}NDIR\${SEDeB}NDIR\${SEDeC}1\${SEDeD}
  508. "
  509. }
  510.  dirheader=ndir.h
  511.  
  512. fi
  513. rm -f conftest*
  514. fi
  515.  
  516. echo checking for closedir return value
  517. cat > conftest.c <<EOF
  518. #include "confdefs.h"
  519. #include <sys/types.h>
  520. #include <$dirheader>
  521. int closedir(); main() { exit(closedir(opendir(".")) != 0); }
  522. EOF
  523. eval $compile
  524. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  525.   :
  526. else
  527.   
  528. {
  529. test -n "$verbose" && \
  530. echo "    defining VOID_CLOSEDIR"
  531. echo "#define" VOID_CLOSEDIR 1 >> confdefs.h
  532. DEFS="$DEFS -DVOID_CLOSEDIR=1"
  533. SEDDEFS="${SEDDEFS}\${SEDdA}VOID_CLOSEDIR\${SEDdB}VOID_CLOSEDIR\${SEDdC}1\${SEDdD}
  534. \${SEDuA}VOID_CLOSEDIR\${SEDuB}VOID_CLOSEDIR\${SEDuC}1\${SEDuD}
  535. \${SEDeA}VOID_CLOSEDIR\${SEDeB}VOID_CLOSEDIR\${SEDeC}1\${SEDeD}
  536. "
  537. }
  538.  
  539. fi
  540. rm -fr conftest*
  541.  
  542. echo checking for uid_t in sys/types.h
  543. echo '#include "confdefs.h"
  544. #include <sys/types.h>' > conftest.c
  545. eval "$CPP conftest.c > conftest.out 2>&1"
  546. if egrep "uid_t" conftest.out >/dev/null 2>&1; then
  547.   :
  548. else
  549.   rm -rf conftest*
  550.   
  551. {
  552. test -n "$verbose" && \
  553. echo "    defining" uid_t to be int
  554. echo "#define" uid_t int >> confdefs.h
  555. DEFS="$DEFS -Duid_t=int"
  556. SEDDEFS="${SEDDEFS}\${SEDdA}uid_t\${SEDdB}uid_t\${SEDdC}int\${SEDdD}
  557. \${SEDuA}uid_t\${SEDuB}uid_t\${SEDuC}int\${SEDuD}
  558. \${SEDeA}uid_t\${SEDeB}uid_t\${SEDeC}int\${SEDeD}
  559. "
  560. }
  561.  
  562. {
  563. test -n "$verbose" && \
  564. echo "    defining" gid_t to be int
  565. echo "#define" gid_t int >> confdefs.h
  566. DEFS="$DEFS -Dgid_t=int"
  567. SEDDEFS="${SEDDEFS}\${SEDdA}gid_t\${SEDdB}gid_t\${SEDdC}int\${SEDdD}
  568. \${SEDuA}gid_t\${SEDuB}gid_t\${SEDuC}int\${SEDuD}
  569. \${SEDeA}gid_t\${SEDeB}gid_t\${SEDeC}int\${SEDeD}
  570. "
  571. }
  572.  
  573. fi
  574. rm -f conftest*
  575.             echo checking for type of array argument to getgroups
  576. prog='/* Thanks to Mike Rendell for this test.  */
  577. #include <sys/types.h>
  578. #define NGID 256
  579. #undef MAX
  580. #define MAX(x,y) ((x) > (y) ? (x) : (y))
  581. main()
  582. {
  583.   gid_t gidset[NGID];
  584.   int i, n;
  585.   union { gid_t gval; long lval; }  val;
  586.  
  587.   val.lval = -1;
  588.   for (i = 0; i < NGID; i++)
  589.     gidset[i] = val.gval;
  590.   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
  591.                  gidset);
  592.   /* Exit non-zero if getgroups seems to require an array of ints.  This
  593.      happens when gid_t is short but getgroups modifies an array of ints.  */
  594.   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
  595. }'
  596. cat > conftest.c <<EOF
  597. #include "confdefs.h"
  598. $prog
  599. EOF
  600. eval $compile
  601. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  602.   
  603. {
  604. test -n "$verbose" && \
  605. echo "    defining" GETGROUPS_T to be gid_t
  606. echo "#define" GETGROUPS_T gid_t >> confdefs.h
  607. DEFS="$DEFS -DGETGROUPS_T=gid_t"
  608. SEDDEFS="${SEDDEFS}\${SEDdA}GETGROUPS_T\${SEDdB}GETGROUPS_T\${SEDdC}gid_t\${SEDdD}
  609. \${SEDuA}GETGROUPS_T\${SEDuB}GETGROUPS_T\${SEDuC}gid_t\${SEDuD}
  610. \${SEDeA}GETGROUPS_T\${SEDeB}GETGROUPS_T\${SEDeC}gid_t\${SEDeD}
  611. "
  612. }
  613.  
  614.  
  615. else
  616.   
  617. {
  618. test -n "$verbose" && \
  619. echo "    defining" GETGROUPS_T to be int
  620. echo "#define" GETGROUPS_T int >> confdefs.h
  621. DEFS="$DEFS -DGETGROUPS_T=int"
  622. SEDDEFS="${SEDDEFS}\${SEDdA}GETGROUPS_T\${SEDdB}GETGROUPS_T\${SEDdC}int\${SEDdD}
  623. \${SEDuA}GETGROUPS_T\${SEDuB}GETGROUPS_T\${SEDuC}int\${SEDuD}
  624. \${SEDeA}GETGROUPS_T\${SEDeB}GETGROUPS_T\${SEDeC}int\${SEDeD}
  625. "
  626. }
  627.  
  628. fi
  629. rm -fr conftest*
  630.  
  631. echo checking for pid_t in sys/types.h
  632. echo '#include "confdefs.h"
  633. #include <sys/types.h>' > conftest.c
  634. eval "$CPP conftest.c > conftest.out 2>&1"
  635. if egrep "pid_t" conftest.out >/dev/null 2>&1; then
  636.   :
  637. else
  638.   rm -rf conftest*
  639.   
  640. {
  641. test -n "$verbose" && \
  642. echo "    defining" pid_t to be int
  643. echo "#define" pid_t int >> confdefs.h
  644. DEFS="$DEFS -Dpid_t=int"
  645. SEDDEFS="${SEDDEFS}\${SEDdA}pid_t\${SEDdB}pid_t\${SEDdC}int\${SEDdD}
  646. \${SEDuA}pid_t\${SEDuB}pid_t\${SEDuC}int\${SEDuD}
  647. \${SEDeA}pid_t\${SEDeB}pid_t\${SEDeC}int\${SEDeD}
  648. "
  649. }
  650.  
  651. fi
  652. rm -f conftest*
  653.  
  654. echo checking for return type of signal handlers
  655. cat > conftest.c <<EOF
  656. #include "confdefs.h"
  657. #include <sys/types.h>
  658. #include <signal.h>
  659. #ifdef signal
  660. #undef signal
  661. #endif
  662. extern void (*signal ()) ();
  663. int main() { exit(0); }
  664. int t() { int i; }
  665. EOF
  666. if eval $compile; then
  667.   rm -rf conftest*
  668.   
  669. {
  670. test -n "$verbose" && \
  671. echo "    defining" RETSIGTYPE to be void
  672. echo "#define" RETSIGTYPE void >> confdefs.h
  673. DEFS="$DEFS -DRETSIGTYPE=void"
  674. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
  675. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
  676. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
  677. "
  678. }
  679.  
  680.  
  681. else
  682.   rm -rf conftest*
  683.   
  684. {
  685. test -n "$verbose" && \
  686. echo "    defining" RETSIGTYPE to be int
  687. echo "#define" RETSIGTYPE int >> confdefs.h
  688. DEFS="$DEFS -DRETSIGTYPE=int"
  689. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
  690. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
  691. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
  692. "
  693. }
  694.  
  695. fi
  696. rm -f conftest*
  697.  
  698.  
  699. for hdr in unistd.h limits.h sys/param.h fcntl.h string.h memory.h \
  700.             sys/timeb.h
  701. do
  702. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  703. echo checking for ${hdr}
  704. cat > conftest.c <<EOF
  705. #include "confdefs.h"
  706. #include <${hdr}>
  707. EOF
  708. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  709. if test -z "$err"; then
  710.   rm -rf conftest*
  711.   
  712. {
  713. test -n "$verbose" && \
  714. echo "    defining ${trhdr}"
  715. echo "#define" ${trhdr} 1 >> confdefs.h
  716. DEFS="$DEFS -D${trhdr}=1"
  717. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  718. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  719. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  720. "
  721. }
  722.  
  723.  
  724. fi
  725. rm -f conftest*
  726. done
  727.  
  728. echo checking whether $CC and cc understand -c and -o together
  729. echo 'foo(){}' > conftest.c
  730. # Make sure it works both with $CC and with simple cc.
  731. # We do the test twice because some compilers refuse to overwrite an
  732. # existing .o file with -o, though they will create one.
  733. if ${CC-cc} -c conftest.c -o conftest.o >/dev/null 2>&1 \
  734.  && test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o >/dev/null 2>&1
  735. then
  736.   # Test first that cc exists at all.
  737.   if cc -c conftest.c >/dev/null 2>&1
  738.   then
  739.     if cc -c conftest.c -o conftest2.o >/dev/null 2>&1 && \
  740.        test -f conftest2.o && cc -c conftest.c -o conftest2.o >/dev/null 2>&1
  741.     then
  742.       :
  743.     else
  744.       
  745. {
  746. test -n "$verbose" && \
  747. echo "    defining NO_MINUS_C_MINUS_O"
  748. echo "#define" NO_MINUS_C_MINUS_O 1 >> confdefs.h
  749. DEFS="$DEFS -DNO_MINUS_C_MINUS_O=1"
  750. SEDDEFS="${SEDDEFS}\${SEDdA}NO_MINUS_C_MINUS_O\${SEDdB}NO_MINUS_C_MINUS_O\${SEDdC}1\${SEDdD}
  751. \${SEDuA}NO_MINUS_C_MINUS_O\${SEDuB}NO_MINUS_C_MINUS_O\${SEDuC}1\${SEDuD}
  752. \${SEDeA}NO_MINUS_C_MINUS_O\${SEDeB}NO_MINUS_C_MINUS_O\${SEDeC}1\${SEDeD}
  753. "
  754. }
  755.  
  756.     fi
  757.   fi
  758. else
  759.   
  760. {
  761. test -n "$verbose" && \
  762. echo "    defining NO_MINUS_C_MINUS_O"
  763. echo "#define" NO_MINUS_C_MINUS_O 1 >> confdefs.h
  764. DEFS="$DEFS -DNO_MINUS_C_MINUS_O=1"
  765. SEDDEFS="${SEDDEFS}\${SEDdA}NO_MINUS_C_MINUS_O\${SEDdB}NO_MINUS_C_MINUS_O\${SEDdC}1\${SEDdD}
  766. \${SEDuA}NO_MINUS_C_MINUS_O\${SEDuB}NO_MINUS_C_MINUS_O\${SEDuC}1\${SEDuD}
  767. \${SEDeA}NO_MINUS_C_MINUS_O\${SEDeB}NO_MINUS_C_MINUS_O\${SEDeC}1\${SEDeD}
  768. "
  769. }
  770.  
  771. fi
  772. rm -f conftest*
  773.  
  774. prog='/* Ultrix mips cc rejects this.  */
  775. typedef int charset[2]; const charset x;
  776. /* SunOS 4.1.1 cc rejects this.  */
  777. char const *const *ccp;
  778. char **p;
  779. /* AIX XL C 1.02.0.0 rejects this.
  780.    It does not let you subtract one const X* pointer from another in an arm
  781.    of an if-expression whose if-part is not a constant expression */
  782. const char *g = "string";
  783. ccp = &g + (g ? g-g : 0);
  784. /* HPUX 7.0 cc rejects these. */
  785. ++ccp;
  786. p = (char**) ccp;
  787. ccp = (char const *const *) p;
  788. { /* SCO 3.2v4 cc rejects this.  */
  789.   char *t;
  790.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  791.  
  792.   *t++ = 0;
  793. }
  794. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  795.   int x[] = {25,17};
  796.   const int *foo = &x[0];
  797.   ++foo;
  798. }
  799. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  800.   typedef const int *iptr;
  801.   iptr p = 0;
  802.   ++p;
  803. }
  804. { /* AIX XL C 1.02.0.0 rejects this saying
  805.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  806.   struct s { int j; const int *ap[3]; };
  807.   struct s *b; b->j = 5;
  808. }
  809. { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  810.   const int foo = 10;
  811. }'
  812. echo checking for lack of working const
  813. cat > conftest.c <<EOF
  814. #include "confdefs.h"
  815.  
  816. int main() { exit(0); }
  817. int t() { $prog }
  818. EOF
  819. if eval $compile; then
  820.   :
  821. else
  822.   rm -rf conftest*
  823.   
  824. {
  825. test -n "$verbose" && \
  826. echo "    defining" const to be empty
  827. echo "#define" const  >> confdefs.h
  828. DEFS="$DEFS -Dconst="
  829. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  830. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  831. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  832. "
  833. }
  834.  
  835. fi
  836. rm -f conftest*
  837.             echo checking for broken stat file mode macros
  838. cat > conftest.c <<EOF
  839. #include "confdefs.h"
  840. #include <sys/types.h>
  841. #include <sys/stat.h>
  842. #ifdef S_ISBLK
  843. #if S_ISBLK (S_IFDIR)
  844. You lose.
  845. #endif
  846. #ifdef S_IFCHR
  847. #if S_ISBLK (S_IFCHR)
  848. You lose.
  849. #endif
  850. #endif /* S_IFCHR */
  851. #endif /* S_ISBLK */
  852. #ifdef S_ISLNK
  853. #if S_ISLNK (S_IFREG)
  854. You lose.
  855. #endif
  856. #endif /* S_ISLNK */
  857. #ifdef S_ISSOCK
  858. #if S_ISSOCK (S_IFREG)
  859. You lose.
  860. #endif
  861. #endif /* S_ISSOCK */
  862.  
  863. EOF
  864. eval "$CPP conftest.c > conftest.out 2>&1"
  865. if egrep "You lose" conftest.out >/dev/null 2>&1; then
  866.   rm -rf conftest*
  867.   
  868. {
  869. test -n "$verbose" && \
  870. echo "    defining STAT_MACROS_BROKEN"
  871. echo "#define" STAT_MACROS_BROKEN 1 >> confdefs.h
  872. DEFS="$DEFS -DSTAT_MACROS_BROKEN=1"
  873. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_MACROS_BROKEN\${SEDdB}STAT_MACROS_BROKEN\${SEDdC}1\${SEDdD}
  874. \${SEDuA}STAT_MACROS_BROKEN\${SEDuB}STAT_MACROS_BROKEN\${SEDuC}1\${SEDuD}
  875. \${SEDeA}STAT_MACROS_BROKEN\${SEDeB}STAT_MACROS_BROKEN\${SEDeC}1\${SEDeD}
  876. "
  877. }
  878.  
  879.  
  880. fi
  881. rm -f conftest*
  882.  
  883.  
  884.  
  885.  
  886. for func in getdtablesize sys_siglist _sys_siglist psignal \
  887.           dup2 getcwd sigsetmask getgroups setlinebuf \
  888.           setreuid setregid
  889. do
  890. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  891. echo checking for ${func}
  892. cat > conftest.c <<EOF
  893. #include "confdefs.h"
  894. #include <ctype.h>
  895. int main() { exit(0); }
  896. int t() { 
  897. /* The GNU C library defines this for functions which it implements
  898.     to always fail with ENOSYS.  Some functions are actually named
  899.     something starting with __ and the normal name is an alias.  */
  900. #if defined (__stub_${func}) || defined (__stub___${func})
  901. choke me
  902. #else
  903. /* Override any gcc2 internal prototype to avoid an error.  */
  904. extern char ${func}(); ${func}();
  905. #endif
  906.  }
  907. EOF
  908. if eval $compile; then
  909.   rm -rf conftest*
  910.   {
  911. test -n "$verbose" && \
  912. echo "    defining ${trfunc}"
  913. echo "#define" ${trfunc} 1 >> confdefs.h
  914. DEFS="$DEFS -D${trfunc}=1"
  915. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  916. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  917. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  918. "
  919. }
  920.  
  921.  
  922. fi
  923. rm -f conftest*
  924. done
  925.  
  926. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  927. # for constant arguments.  Useless!
  928. echo checking for working alloca.h
  929. cat > conftest.c <<EOF
  930. #include "confdefs.h"
  931. #include <alloca.h>
  932. int main() { exit(0); }
  933. int t() { char *p = alloca(2 * sizeof(int)); }
  934. EOF
  935. if eval $compile; then
  936.   rm -rf conftest*
  937.   
  938. {
  939. test -n "$verbose" && \
  940. echo "    defining HAVE_ALLOCA_H"
  941. echo "#define" HAVE_ALLOCA_H 1 >> confdefs.h
  942. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  943. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ALLOCA_H\${SEDdB}HAVE_ALLOCA_H\${SEDdC}1\${SEDdD}
  944. \${SEDuA}HAVE_ALLOCA_H\${SEDuB}HAVE_ALLOCA_H\${SEDuC}1\${SEDuD}
  945. \${SEDeA}HAVE_ALLOCA_H\${SEDeB}HAVE_ALLOCA_H\${SEDeC}1\${SEDeD}
  946. "
  947. }
  948.  
  949.  
  950. fi
  951. rm -f conftest*
  952.  
  953. decl="#ifdef __GNUC__
  954. #define alloca __builtin_alloca
  955. #else
  956. #if HAVE_ALLOCA_H
  957. #include <alloca.h>
  958. #else
  959. #ifdef _AIX
  960.  #pragma alloca
  961. #else
  962. char *alloca ();
  963. #endif
  964. #endif
  965. #endif
  966. "
  967. echo checking for alloca
  968. cat > conftest.c <<EOF
  969. #include "confdefs.h"
  970. $decl
  971. int main() { exit(0); }
  972. int t() { char *p = (char *) alloca(1); }
  973. EOF
  974. if eval $compile; then
  975.   :
  976. else
  977.   rm -rf conftest*
  978.   alloca_missing=1
  979. cat > conftest.c <<EOF
  980. #include "confdefs.h"
  981.  
  982. #if defined(CRAY) && ! defined(CRAY2)
  983. winnitude
  984. #else
  985. lossage
  986. #endif
  987.  
  988. EOF
  989. eval "$CPP conftest.c > conftest.out 2>&1"
  990. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  991.   rm -rf conftest*
  992.   echo checking for _getb67
  993. cat > conftest.c <<EOF
  994. #include "confdefs.h"
  995. #include <ctype.h>
  996. int main() { exit(0); }
  997. int t() { 
  998. /* The GNU C library defines this for functions which it implements
  999.     to always fail with ENOSYS.  Some functions are actually named
  1000.     something starting with __ and the normal name is an alias.  */
  1001. #if defined (__stub__getb67) || defined (__stub____getb67)
  1002. choke me
  1003. #else
  1004. /* Override any gcc2 internal prototype to avoid an error.  */
  1005. extern char _getb67(); _getb67();
  1006. #endif
  1007.  }
  1008. EOF
  1009. if eval $compile; then
  1010.   rm -rf conftest*
  1011.   {
  1012. test -n "$verbose" && \
  1013. echo "    defining" CRAY_STACKSEG_END to be _getb67
  1014. echo "#define" CRAY_STACKSEG_END _getb67 >> confdefs.h
  1015. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  1016. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}_getb67\${SEDdD}
  1017. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}_getb67\${SEDuD}
  1018. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}_getb67\${SEDeD}
  1019. "
  1020. }
  1021.  
  1022.  
  1023. else
  1024.   rm -rf conftest*
  1025.   echo checking for GETB67
  1026. cat > conftest.c <<EOF
  1027. #include "confdefs.h"
  1028. #include <ctype.h>
  1029. int main() { exit(0); }
  1030. int t() { 
  1031. /* The GNU C library defines this for functions which it implements
  1032.     to always fail with ENOSYS.  Some functions are actually named
  1033.     something starting with __ and the normal name is an alias.  */
  1034. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  1035. choke me
  1036. #else
  1037. /* Override any gcc2 internal prototype to avoid an error.  */
  1038. extern char GETB67(); GETB67();
  1039. #endif
  1040.  }
  1041. EOF
  1042. if eval $compile; then
  1043.   rm -rf conftest*
  1044.   {
  1045. test -n "$verbose" && \
  1046. echo "    defining" CRAY_STACKSEG_END to be GETB67
  1047. echo "#define" CRAY_STACKSEG_END GETB67 >> confdefs.h
  1048. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  1049. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}GETB67\${SEDdD}
  1050. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}GETB67\${SEDuD}
  1051. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}GETB67\${SEDeD}
  1052. "
  1053. }
  1054.  
  1055.  
  1056. else
  1057.   rm -rf conftest*
  1058.   echo checking for getb67
  1059. cat > conftest.c <<EOF
  1060. #include "confdefs.h"
  1061. #include <ctype.h>
  1062. int main() { exit(0); }
  1063. int t() { 
  1064. /* The GNU C library defines this for functions which it implements
  1065.     to always fail with ENOSYS.  Some functions are actually named
  1066.     something starting with __ and the normal name is an alias.  */
  1067. #if defined (__stub_getb67) || defined (__stub___getb67)
  1068. choke me
  1069. #else
  1070. /* Override any gcc2 internal prototype to avoid an error.  */
  1071. extern char getb67(); getb67();
  1072. #endif
  1073.  }
  1074. EOF
  1075. if eval $compile; then
  1076.   rm -rf conftest*
  1077.   {
  1078. test -n "$verbose" && \
  1079. echo "    defining" CRAY_STACKSEG_END to be getb67
  1080. echo "#define" CRAY_STACKSEG_END getb67 >> confdefs.h
  1081. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  1082. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}getb67\${SEDdD}
  1083. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}getb67\${SEDuD}
  1084. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}getb67\${SEDeD}
  1085. "
  1086. }
  1087.  
  1088.  
  1089. fi
  1090. rm -f conftest*
  1091.  
  1092. fi
  1093. rm -f conftest*
  1094.  
  1095. fi
  1096. rm -f conftest*
  1097.  
  1098.  
  1099. fi
  1100. rm -f conftest*
  1101.  
  1102.  
  1103. fi
  1104. rm -f conftest*
  1105.  
  1106. if test -n "$alloca_missing"; then
  1107.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  1108.   # that cause trouble.  Some versions do not even contain alloca or
  1109.   # contain a buggy version.  If you still want to use their alloca,
  1110.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  1111.   ALLOCA=alloca.o
  1112.   
  1113. {
  1114. test -n "$verbose" && \
  1115. echo "    defining C_ALLOCA"
  1116. echo "#define" C_ALLOCA 1 >> confdefs.h
  1117. DEFS="$DEFS -DC_ALLOCA=1"
  1118. SEDDEFS="${SEDDEFS}\${SEDdA}C_ALLOCA\${SEDdB}C_ALLOCA\${SEDdC}1\${SEDdD}
  1119. \${SEDuA}C_ALLOCA\${SEDuB}C_ALLOCA\${SEDuC}1\${SEDuD}
  1120. \${SEDeA}C_ALLOCA\${SEDeB}C_ALLOCA\${SEDeC}1\${SEDeD}
  1121. "
  1122. }
  1123.  
  1124.  
  1125.   echo 'checking stack direction for C alloca'
  1126.   echo checking whether cross-compiling
  1127. # If we cannot run a trivial program, we must be cross compiling.
  1128. cat > conftest.c <<EOF
  1129. #include "confdefs.h"
  1130. main(){exit(0);}
  1131. EOF
  1132. eval $compile
  1133. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1134.   :
  1135. else
  1136.   cross_compiling=1
  1137. fi
  1138. rm -fr conftest*
  1139.  
  1140. if test -n "$cross_compiling"
  1141. then
  1142.   
  1143. {
  1144. test -n "$verbose" && \
  1145. echo "    defining" STACK_DIRECTION to be 0
  1146. echo "#define" STACK_DIRECTION 0 >> confdefs.h
  1147. DEFS="$DEFS -DSTACK_DIRECTION=0"
  1148. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}0\${SEDdD}
  1149. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}0\${SEDuD}
  1150. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}0\${SEDeD}
  1151. "
  1152. }
  1153.  
  1154. else
  1155. cat > conftest.c <<EOF
  1156. #include "confdefs.h"
  1157. find_stack_direction ()
  1158. {
  1159.   static char *addr = 0;
  1160.   auto char dummy;
  1161.   if (addr == 0)
  1162.     {
  1163.       addr = &dummy;
  1164.       return find_stack_direction ();
  1165.     }
  1166.   else
  1167.     return (&dummy > addr) ? 1 : -1;
  1168. }
  1169. main ()
  1170. {
  1171.   exit (find_stack_direction() < 0);
  1172. }
  1173. EOF
  1174. eval $compile
  1175. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1176.   
  1177. {
  1178. test -n "$verbose" && \
  1179. echo "    defining" STACK_DIRECTION to be 1
  1180. echo "#define" STACK_DIRECTION 1 >> confdefs.h
  1181. DEFS="$DEFS -DSTACK_DIRECTION=1"
  1182. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}1\${SEDdD}
  1183. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}1\${SEDuD}
  1184. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}1\${SEDeD}
  1185. "
  1186. }
  1187.  
  1188.  
  1189. else
  1190.   
  1191. {
  1192. test -n "$verbose" && \
  1193. echo "    defining" STACK_DIRECTION to be -1
  1194. echo "#define" STACK_DIRECTION -1 >> confdefs.h
  1195. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  1196. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}-1\${SEDdD}
  1197. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}-1\${SEDuD}
  1198. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}-1\${SEDeD}
  1199. "
  1200. }
  1201.  
  1202. fi
  1203. fi
  1204. rm -fr conftest*
  1205. fi
  1206.  
  1207. echo checking for vfork.h
  1208. cat > conftest.c <<EOF
  1209. #include "confdefs.h"
  1210. #include <vfork.h>
  1211. EOF
  1212. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1213. if test -z "$err"; then
  1214.   rm -rf conftest*
  1215.   
  1216. {
  1217. test -n "$verbose" && \
  1218. echo "    defining HAVE_VFORK_H"
  1219. echo "#define" HAVE_VFORK_H 1 >> confdefs.h
  1220. DEFS="$DEFS -DHAVE_VFORK_H=1"
  1221. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VFORK_H\${SEDdB}HAVE_VFORK_H\${SEDdC}1\${SEDdD}
  1222. \${SEDuA}HAVE_VFORK_H\${SEDuB}HAVE_VFORK_H\${SEDuC}1\${SEDuD}
  1223. \${SEDeA}HAVE_VFORK_H\${SEDeB}HAVE_VFORK_H\${SEDeC}1\${SEDeD}
  1224. "
  1225. }
  1226.  
  1227.  
  1228. fi
  1229. rm -f conftest*
  1230.  
  1231. echo checking for working vfork
  1232.  
  1233. cat > conftest.c <<EOF
  1234. #include "confdefs.h"
  1235. /* Thanks to Paul Eggert for this test.  */
  1236. #include <stdio.h>
  1237. #include <sys/types.h>
  1238. #include <sys/stat.h>
  1239. #include <signal.h>
  1240. #ifdef HAVE_UNISTD_H
  1241. #include <unistd.h>
  1242. #endif
  1243. #ifdef HAVE_VFORK_H
  1244. #include <vfork.h>
  1245. #endif
  1246. static int signalled;
  1247. static RETSIGTYPE catch (s) int s; { signalled = 1; }
  1248. main() {
  1249.   pid_t parent = getpid ();
  1250.   pid_t child;
  1251.  
  1252.   signal (SIGINT, catch);
  1253.  
  1254.   child = vfork ();
  1255.  
  1256.   if (child == 0) {
  1257.     /* On sparc systems, changes by the child to local and incoming
  1258.        argument registers are propagated back to the parent.
  1259.        The compiler is told about this with #include <vfork.h>,
  1260.        but some compilers (e.g. gcc -O) don't grok <vfork.h>.
  1261.        Test for this by using lots of local variables, at least
  1262.        as many local variables as main has allocated so far
  1263.        including compiler temporaries.  4 locals are enough for
  1264.        gcc 1.40.3 on a sparc, but we use 8 to be safe.
  1265.        A buggy compiler should reuse the register of parent
  1266.        for one of the local variables, since it will think that
  1267.        parent can't possibly be used any more in this routine.
  1268.        Assigning to the local variable will thus munge parent
  1269.        in the parent process.  */
  1270.     pid_t
  1271.       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
  1272.       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
  1273.     /* Convince the compiler that p..p7 are live; otherwise, it might
  1274.        use the same hardware register for all 8 local variables.  */
  1275.     if (p != p1 || p != p2 || p != p3 || p != p4
  1276.     || p != p5 || p != p6 || p != p7)
  1277.       _exit(1);
  1278.  
  1279.     /* On some systems (e.g. SunOS 5.2), if the parent is catching
  1280.        a signal, the child ignores the signal before execing,
  1281.        and the parent later receives that signal, the parent dumps core.
  1282.        Test for this by ignoring SIGINT in the child.  */
  1283.     signal (SIGINT, SIG_IGN);
  1284.  
  1285.     /* On some systems (e.g. IRIX 3.3),
  1286.        vfork doesn't separate parent from child file descriptors.
  1287.        If the child closes a descriptor before it execs or exits,
  1288.        this munges the parent's descriptor as well.
  1289.        Test for this by closing stdout in the child.  */
  1290.     _exit(close(fileno(stdout)) != 0);
  1291.   } else {
  1292.     int status;
  1293.     struct stat st;
  1294.  
  1295.     while (wait(&status) != child)
  1296.       ;
  1297.     exit(
  1298.      /* Was there some problem with vforking?  */
  1299.      child < 0
  1300.  
  1301.      /* Did the child fail?  (This shouldn't happen.)  */
  1302.      || status
  1303.  
  1304.      /* Did the vfork/compiler bug occur?  */
  1305.      || parent != getpid()
  1306.  
  1307.      /* Did the signal handling bug occur?  */
  1308.      || kill(parent, SIGINT) != 0
  1309.      || signalled != 1
  1310.  
  1311.      /* Did the file descriptor bug occur?  */
  1312.      || fstat(fileno(stdout), &st) != 0
  1313.      );
  1314.   }
  1315. }
  1316. EOF
  1317. eval $compile
  1318. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1319.   :
  1320. else
  1321.   
  1322. {
  1323. test -n "$verbose" && \
  1324. echo "    defining" vfork to be fork
  1325. echo "#define" vfork fork >> confdefs.h
  1326. DEFS="$DEFS -Dvfork=fork"
  1327. SEDDEFS="${SEDDEFS}\${SEDdA}vfork\${SEDdB}vfork\${SEDdC}fork\${SEDdD}
  1328. \${SEDuA}vfork\${SEDuB}vfork\${SEDuC}fork\${SEDuD}
  1329. \${SEDeA}vfork\${SEDeB}vfork\${SEDeC}fork\${SEDeD}
  1330. "
  1331. }
  1332.  
  1333. fi
  1334. rm -fr conftest*
  1335.  
  1336. cat > conftest.c <<EOF
  1337. #include "confdefs.h"
  1338. #include <stdio.h>
  1339. /* If setvbuf has the reversed format, exit 0. */
  1340. main () {
  1341.   /* This call has the arguments reversed.
  1342.      A reversed system may check and see that the address of main
  1343.      is not _IOLBF, _IONBF, or _IOFBF, and return nonzero.  */
  1344.   if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
  1345.     exit(1);
  1346.   putc('\r', stdout);
  1347.   exit(0);            /* Non-reversed systems segv here.  */
  1348. }
  1349. EOF
  1350. eval $compile
  1351. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1352.   
  1353. {
  1354. test -n "$verbose" && \
  1355. echo "    defining SETVBUF_REVERSED"
  1356. echo "#define" SETVBUF_REVERSED 1 >> confdefs.h
  1357. DEFS="$DEFS -DSETVBUF_REVERSED=1"
  1358. SEDDEFS="${SEDDEFS}\${SEDdA}SETVBUF_REVERSED\${SEDdB}SETVBUF_REVERSED\${SEDdC}1\${SEDdD}
  1359. \${SEDuA}SETVBUF_REVERSED\${SEDuB}SETVBUF_REVERSED\${SEDuC}1\${SEDuD}
  1360. \${SEDeA}SETVBUF_REVERSED\${SEDeB}SETVBUF_REVERSED\${SEDeC}1\${SEDeD}
  1361. "
  1362. }
  1363.  
  1364.  
  1365. fi
  1366. rm -fr conftest*
  1367. rm -f core
  1368.  
  1369. # Some definitions of getloadavg require that the program be installed setgid.
  1370. NEED_SETGID=false
  1371. need_func=true
  1372.  
  1373. # Check for the 4.4BSD definition of getloadavg.
  1374. LIBS_save="${LIBS}"
  1375. LIBS="${LIBS} -lutil"
  1376. have_lib=""
  1377. echo checking for -lutil
  1378. cat > conftest.c <<EOF
  1379. #include "confdefs.h"
  1380.  
  1381. int main() { exit(0); }
  1382. int t() { main(); }
  1383. EOF
  1384. if eval $compile; then
  1385.   rm -rf conftest*
  1386.   have_lib="1"
  1387.  
  1388. fi
  1389. rm -f conftest*
  1390. LIBS="${LIBS_save}"
  1391. if test -n "${have_lib}"; then
  1392.    :; LIBS_save="${LIBS}"
  1393. LIBS="${LIBS} -lkvm"
  1394. have_lib=""
  1395. echo checking for -lkvm
  1396. cat > conftest.c <<EOF
  1397. #include "confdefs.h"
  1398.  
  1399. int main() { exit(0); }
  1400. int t() { main(); }
  1401. EOF
  1402. if eval $compile; then
  1403.   rm -rf conftest*
  1404.   have_lib="1"
  1405.  
  1406. fi
  1407. rm -f conftest*
  1408. LIBS="${LIBS_save}"
  1409. if test -n "${have_lib}"; then
  1410.    :; LIBS="$LIBS -lutil -lkvm" need_func=false
  1411. else
  1412.    :; 
  1413. fi
  1414.  
  1415. else
  1416.    :; 
  1417. fi
  1418.  
  1419.  
  1420. if $need_func; then
  1421. # There is a commonly available library for RS/6000 AIX.
  1422. # Since it is not a standard part of AIX, it might be installed locally.
  1423. LIBS_old="$LIBS"
  1424. LIBS="-L/usr/local/lib $LIBS"
  1425. LIBS_save="${LIBS}"
  1426. LIBS="${LIBS} -lgetloadavg"
  1427. have_lib=""
  1428. echo checking for -lgetloadavg
  1429. cat > conftest.c <<EOF
  1430. #include "confdefs.h"
  1431.  
  1432. int main() { exit(0); }
  1433. int t() { main(); }
  1434. EOF
  1435. if eval $compile; then
  1436.   rm -rf conftest*
  1437.   have_lib="1"
  1438.  
  1439. fi
  1440. rm -f conftest*
  1441. LIBS="${LIBS_save}"
  1442. if test -n "${have_lib}"; then
  1443.    :; LIBS="$LIBS -lgetloadavg" need_func=false
  1444. else
  1445.    :; LIBS="$LIBS_old"
  1446. fi
  1447.  
  1448. fi
  1449.  
  1450. # Make sure it is really in the library, if we think we found it at all.
  1451. for func in getloadavg
  1452. do
  1453. echo checking for ${func}
  1454. cat > conftest.c <<EOF
  1455. #include "confdefs.h"
  1456. #include <ctype.h>
  1457. int main() { exit(0); }
  1458. int t() { 
  1459. /* The GNU C library defines this for functions which it implements
  1460.     to always fail with ENOSYS.  Some functions are actually named
  1461.     something starting with __ and the normal name is an alias.  */
  1462. #if defined (__stub_${func}) || defined (__stub___${func})
  1463. choke me
  1464. #else
  1465. /* Override any gcc2 internal prototype to avoid an error.  */
  1466. extern char ${func}(); ${func}();
  1467. #endif
  1468.  }
  1469. EOF
  1470. if eval $compile; then
  1471.   :
  1472. else
  1473.   rm -rf conftest*
  1474.   LIBOBJS="$LIBOBJS ${func}.o"
  1475. test -n "$verbose" && echo "    using ${func}.o instead"
  1476. fi
  1477. rm -f conftest*
  1478.  
  1479. done
  1480.  
  1481.  
  1482. case "$LIBOBJS" in
  1483. *getloadavg*)
  1484. need_func=true
  1485. echo checking for sys/dg_sys_info.h
  1486. cat > conftest.c <<EOF
  1487. #include "confdefs.h"
  1488. #include <sys/dg_sys_info.h>
  1489. EOF
  1490. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1491. if test -z "$err"; then
  1492.   rm -rf conftest*
  1493.   
  1494. {
  1495. test -n "$verbose" && \
  1496. echo "    defining DGUX"
  1497. echo "#define" DGUX 1 >> confdefs.h
  1498. DEFS="$DEFS -DDGUX=1"
  1499. SEDDEFS="${SEDDEFS}\${SEDdA}DGUX\${SEDdB}DGUX\${SEDdC}1\${SEDdD}
  1500. \${SEDuA}DGUX\${SEDuB}DGUX\${SEDuC}1\${SEDuD}
  1501. \${SEDeA}DGUX\${SEDeB}DGUX\${SEDeC}1\${SEDeD}
  1502. "
  1503. }
  1504.  need_func=false
  1505. # Some versions of DGUX need -ldgc for dg_sys_info.
  1506. LIBS_save="${LIBS}"
  1507. LIBS="${LIBS} -ldgc"
  1508. have_lib=""
  1509. echo checking for -ldgc
  1510. cat > conftest.c <<EOF
  1511. #include "confdefs.h"
  1512.  
  1513. int main() { exit(0); }
  1514. int t() { main(); }
  1515. EOF
  1516. if eval $compile; then
  1517.   rm -rf conftest*
  1518.   have_lib="1"
  1519.  
  1520. fi
  1521. rm -f conftest*
  1522. LIBS="${LIBS_save}"
  1523. if test -n "${have_lib}"; then
  1524.    
  1525. {
  1526. test -n "$verbose" && \
  1527. echo "    defining HAVE_LIBDGC"
  1528. echo "#define" HAVE_LIBDGC 1 >> confdefs.h
  1529. DEFS="$DEFS -DHAVE_LIBDGC=1"
  1530. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBDGC\${SEDdB}HAVE_LIBDGC\${SEDdC}1\${SEDdD}
  1531. \${SEDuA}HAVE_LIBDGC\${SEDuB}HAVE_LIBDGC\${SEDuC}1\${SEDuD}
  1532. \${SEDeA}HAVE_LIBDGC\${SEDeB}HAVE_LIBDGC\${SEDeC}1\${SEDeD}
  1533. "
  1534. }
  1535.  
  1536.    LIBS="${LIBS} -ldgc"
  1537. fi
  1538.  
  1539.  
  1540. fi
  1541. rm -f conftest*
  1542.  
  1543. if $need_func; then
  1544. # We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
  1545. # uses stabs), but it's still SVR4.  We cannot check for <elf.h> because
  1546. # Irix 4.0.5F has the header but not the library.
  1547. LIBS_save="${LIBS}"
  1548. LIBS="${LIBS} -lelf"
  1549. have_lib=""
  1550. echo checking for -lelf
  1551. cat > conftest.c <<EOF
  1552. #include "confdefs.h"
  1553.  
  1554. int main() { exit(0); }
  1555. int t() { main(); }
  1556. EOF
  1557. if eval $compile; then
  1558.   rm -rf conftest*
  1559.   have_lib="1"
  1560.  
  1561. fi
  1562. rm -f conftest*
  1563. LIBS="${LIBS_save}"
  1564. if test -n "${have_lib}"; then
  1565.    :; 
  1566. {
  1567. test -n "$verbose" && \
  1568. echo "    defining SVR4"
  1569. echo "#define" SVR4 1 >> confdefs.h
  1570. DEFS="$DEFS -DSVR4=1"
  1571. SEDDEFS="${SEDDEFS}\${SEDdA}SVR4\${SEDdB}SVR4\${SEDdC}1\${SEDdD}
  1572. \${SEDuA}SVR4\${SEDuB}SVR4\${SEDuC}1\${SEDuD}
  1573. \${SEDeA}SVR4\${SEDeB}SVR4\${SEDeC}1\${SEDeD}
  1574. "
  1575. }
  1576.  LIBS="$LIBS -lelf" need_func=false
  1577.   LIBS_save="${LIBS}"
  1578. LIBS="${LIBS} -lkvm"
  1579. have_lib=""
  1580. echo checking for -lkvm
  1581. cat > conftest.c <<EOF
  1582. #include "confdefs.h"
  1583.  
  1584. int main() { exit(0); }
  1585. int t() { main(); }
  1586. EOF
  1587. if eval $compile; then
  1588.   rm -rf conftest*
  1589.   have_lib="1"
  1590.  
  1591. fi
  1592. rm -f conftest*
  1593. LIBS="${LIBS_save}"
  1594. if test -n "${have_lib}"; then
  1595.    :; LIBS="$LIBS -lkvm"
  1596. else
  1597.    :; 
  1598. fi
  1599.  
  1600. else
  1601.    :; 
  1602. fi
  1603.  
  1604. fi
  1605. if $need_func; then
  1606. echo checking for inq_stats/cpustats.h
  1607. cat > conftest.c <<EOF
  1608. #include "confdefs.h"
  1609. #include <inq_stats/cpustats.h>
  1610. EOF
  1611. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1612. if test -z "$err"; then
  1613.   rm -rf conftest*
  1614.   
  1615. {
  1616. test -n "$verbose" && \
  1617. echo "    defining UMAX4_3"
  1618. echo "#define" UMAX4_3 1 >> confdefs.h
  1619. DEFS="$DEFS -DUMAX4_3=1"
  1620. SEDDEFS="${SEDDEFS}\${SEDdA}UMAX4_3\${SEDdB}UMAX4_3\${SEDdC}1\${SEDdD}
  1621. \${SEDuA}UMAX4_3\${SEDuB}UMAX4_3\${SEDuC}1\${SEDuD}
  1622. \${SEDeA}UMAX4_3\${SEDeB}UMAX4_3\${SEDeC}1\${SEDeD}
  1623. "
  1624. }
  1625.  
  1626. {
  1627. test -n "$verbose" && \
  1628. echo "    defining UMAX"
  1629. echo "#define" UMAX 1 >> confdefs.h
  1630. DEFS="$DEFS -DUMAX=1"
  1631. SEDDEFS="${SEDDEFS}\${SEDdA}UMAX\${SEDdB}UMAX\${SEDdC}1\${SEDdD}
  1632. \${SEDuA}UMAX\${SEDuB}UMAX\${SEDuC}1\${SEDuD}
  1633. \${SEDeA}UMAX\${SEDeB}UMAX\${SEDeC}1\${SEDeD}
  1634. "
  1635. }
  1636.  
  1637.   need_func=false
  1638.  
  1639. fi
  1640. rm -f conftest*
  1641.  
  1642. fi
  1643. if $need_func; then
  1644. echo checking for sys/cpustats.h
  1645. cat > conftest.c <<EOF
  1646. #include "confdefs.h"
  1647. #include <sys/cpustats.h>
  1648. EOF
  1649. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1650. if test -z "$err"; then
  1651.   rm -rf conftest*
  1652.   
  1653. {
  1654. test -n "$verbose" && \
  1655. echo "    defining UMAX"
  1656. echo "#define" UMAX 1 >> confdefs.h
  1657. DEFS="$DEFS -DUMAX=1"
  1658. SEDDEFS="${SEDDEFS}\${SEDdA}UMAX\${SEDdB}UMAX\${SEDdC}1\${SEDdD}
  1659. \${SEDuA}UMAX\${SEDuB}UMAX\${SEDuC}1\${SEDuD}
  1660. \${SEDeA}UMAX\${SEDeB}UMAX\${SEDeC}1\${SEDeD}
  1661. "
  1662. }
  1663.  need_func=false
  1664.  
  1665. fi
  1666. rm -f conftest*
  1667.  
  1668. fi
  1669. if $need_func; then
  1670. for hdr in mach/mach.h
  1671. do
  1672. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  1673. echo checking for ${hdr}
  1674. cat > conftest.c <<EOF
  1675. #include "confdefs.h"
  1676. #include <${hdr}>
  1677. EOF
  1678. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1679. if test -z "$err"; then
  1680.   rm -rf conftest*
  1681.   
  1682. {
  1683. test -n "$verbose" && \
  1684. echo "    defining ${trhdr}"
  1685. echo "#define" ${trhdr} 1 >> confdefs.h
  1686. DEFS="$DEFS -D${trhdr}=1"
  1687. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  1688. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  1689. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  1690. "
  1691. }
  1692.  
  1693.  
  1694. fi
  1695. rm -f conftest*
  1696. done
  1697.  
  1698. fi
  1699.  
  1700. echo checking for nlist.h
  1701. cat > conftest.c <<EOF
  1702. #include "confdefs.h"
  1703. #include <nlist.h>
  1704. EOF
  1705. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1706. if test -z "$err"; then
  1707.   rm -rf conftest*
  1708.   
  1709. {
  1710. test -n "$verbose" && \
  1711. echo "    defining NLIST_STRUCT"
  1712. echo "#define" NLIST_STRUCT 1 >> confdefs.h
  1713. DEFS="$DEFS -DNLIST_STRUCT=1"
  1714. SEDDEFS="${SEDDEFS}\${SEDdA}NLIST_STRUCT\${SEDdB}NLIST_STRUCT\${SEDdC}1\${SEDdD}
  1715. \${SEDuA}NLIST_STRUCT\${SEDuB}NLIST_STRUCT\${SEDuC}1\${SEDuD}
  1716. \${SEDeA}NLIST_STRUCT\${SEDeB}NLIST_STRUCT\${SEDeC}1\${SEDeD}
  1717. "
  1718. }
  1719.  
  1720. echo checking for n_un in struct nlist
  1721. cat > conftest.c <<EOF
  1722. #include "confdefs.h"
  1723. #include <nlist.h>
  1724. int main() { exit(0); }
  1725. int t() { struct nlist n; n.n_un.n_name = 0; }
  1726. EOF
  1727. if eval $compile; then
  1728.   rm -rf conftest*
  1729.   
  1730. {
  1731. test -n "$verbose" && \
  1732. echo "    defining NLIST_NAME_UNION"
  1733. echo "#define" NLIST_NAME_UNION 1 >> confdefs.h
  1734. DEFS="$DEFS -DNLIST_NAME_UNION=1"
  1735. SEDDEFS="${SEDDEFS}\${SEDdA}NLIST_NAME_UNION\${SEDdB}NLIST_NAME_UNION\${SEDdC}1\${SEDdD}
  1736. \${SEDuA}NLIST_NAME_UNION\${SEDuB}NLIST_NAME_UNION\${SEDuC}1\${SEDuD}
  1737. \${SEDeA}NLIST_NAME_UNION\${SEDeB}NLIST_NAME_UNION\${SEDeC}1\${SEDeD}
  1738. "
  1739. }
  1740.  
  1741.  
  1742. fi
  1743. rm -f conftest*
  1744.  
  1745.  
  1746. fi
  1747. rm -f conftest*
  1748.  
  1749. # Figure out whether we will need to install setgid.
  1750. cat > conftest.c <<EOF
  1751. #include "confdefs.h"
  1752. dnl
  1753. #include "${srcdir}/getloadavg.c"
  1754. #ifdef LDAV_PRIVILEGED
  1755. Yowza Am I SETGID yet
  1756. #endif
  1757. EOF
  1758. eval "$CPP conftest.c > conftest.out 2>&1"
  1759. if egrep "Yowza Am I SETGID yet" conftest.out >/dev/null 2>&1; then
  1760.   rm -rf conftest*
  1761.   
  1762. {
  1763. test -n "$verbose" && \
  1764. echo "    defining GETLOADAVG_PRIVILEGED"
  1765. echo "#define" GETLOADAVG_PRIVILEGED 1 >> confdefs.h
  1766. DEFS="$DEFS -DGETLOADAVG_PRIVILEGED=1"
  1767. SEDDEFS="${SEDDEFS}\${SEDdA}GETLOADAVG_PRIVILEGED\${SEDdB}GETLOADAVG_PRIVILEGED\${SEDdC}1\${SEDdD}
  1768. \${SEDuA}GETLOADAVG_PRIVILEGED\${SEDuB}GETLOADAVG_PRIVILEGED\${SEDuC}1\${SEDuD}
  1769. \${SEDeA}GETLOADAVG_PRIVILEGED\${SEDeB}GETLOADAVG_PRIVILEGED\${SEDeC}1\${SEDeD}
  1770. "
  1771. }
  1772.  NEED_SETGID=true
  1773.  
  1774. fi
  1775. rm -f conftest*
  1776. ;;
  1777.  
  1778. *) 
  1779. {
  1780. test -n "$verbose" && \
  1781. echo "    defining HAVE_GETLOADAVG"
  1782. echo "#define" HAVE_GETLOADAVG 1 >> confdefs.h
  1783. DEFS="$DEFS -DHAVE_GETLOADAVG=1"
  1784. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_GETLOADAVG\${SEDdB}HAVE_GETLOADAVG\${SEDdC}1\${SEDdD}
  1785. \${SEDuA}HAVE_GETLOADAVG\${SEDuB}HAVE_GETLOADAVG\${SEDuC}1\${SEDuD}
  1786. \${SEDeA}HAVE_GETLOADAVG\${SEDeB}HAVE_GETLOADAVG\${SEDeC}1\${SEDeD}
  1787. "
  1788. }
  1789.  ;;
  1790. esac
  1791.  
  1792. if $NEED_SETGID; then
  1793.   # Figure out what group owns /dev/kmem.
  1794.   # The installed program will need to be setgid and owned by that group.
  1795.   # On Solaris, /dev/kmem is a symlink.  Get info on the real file.
  1796.   ls_output=`ls -lgL /dev/kmem 2>/dev/null`
  1797.   # If we got an error (system does not support symlinks), try without -L.
  1798.   test -z "$ls_output" && ls_output=`ls -lg /dev/kmem`
  1799.   KMEM_GROUP=`echo $ls_output \
  1800.     | sed -ne 's/[     ][     ]*/ /g;
  1801.            s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\)  *.*/\1/;
  1802.            / /s/.* //;p;'`
  1803. fi
  1804.  
  1805. echo checking for strcoll
  1806. cat > conftest.c <<EOF
  1807. #include "confdefs.h"
  1808. #include <string.h>
  1809. main ()
  1810. {
  1811.   exit (strcoll ("abc", "def") >= 0 ||
  1812.     strcoll ("ABC", "DEF") >= 0 ||
  1813.     strcoll ("123", "456") >= 0);
  1814. }
  1815. EOF
  1816. eval $compile
  1817. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1818.   
  1819. {
  1820. test -n "$verbose" && \
  1821. echo "    defining HAVE_STRCOLL"
  1822. echo "#define" HAVE_STRCOLL 1 >> confdefs.h
  1823. DEFS="$DEFS -DHAVE_STRCOLL=1"
  1824. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_STRCOLL\${SEDdB}HAVE_STRCOLL\${SEDdC}1\${SEDdD}
  1825. \${SEDuA}HAVE_STRCOLL\${SEDuB}HAVE_STRCOLL\${SEDuC}1\${SEDuD}
  1826. \${SEDeA}HAVE_STRCOLL\${SEDeB}HAVE_STRCOLL\${SEDeC}1\${SEDeD}
  1827. "
  1828. }
  1829.  
  1830.  
  1831. fi
  1832. rm -fr conftest*
  1833.  
  1834. for hdr in sys/wait.h
  1835. do
  1836. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  1837. echo checking for ${hdr}
  1838. cat > conftest.c <<EOF
  1839. #include "confdefs.h"
  1840. #include <${hdr}>
  1841. EOF
  1842. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1843. if test -z "$err"; then
  1844.   rm -rf conftest*
  1845.   
  1846. {
  1847. test -n "$verbose" && \
  1848. echo "    defining ${trhdr}"
  1849. echo "#define" ${trhdr} 1 >> confdefs.h
  1850. DEFS="$DEFS -D${trhdr}=1"
  1851. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  1852. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  1853. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  1854. "
  1855. }
  1856.  
  1857.  
  1858. fi
  1859. rm -f conftest*
  1860. done
  1861.  for func in waitpid wait3
  1862. do
  1863. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  1864. echo checking for ${func}
  1865. cat > conftest.c <<EOF
  1866. #include "confdefs.h"
  1867. #include <ctype.h>
  1868. int main() { exit(0); }
  1869. int t() { 
  1870. /* The GNU C library defines this for functions which it implements
  1871.     to always fail with ENOSYS.  Some functions are actually named
  1872.     something starting with __ and the normal name is an alias.  */
  1873. #if defined (__stub_${func}) || defined (__stub___${func})
  1874. choke me
  1875. #else
  1876. /* Override any gcc2 internal prototype to avoid an error.  */
  1877. extern char ${func}(); ${func}();
  1878. #endif
  1879.  }
  1880. EOF
  1881. if eval $compile; then
  1882.   rm -rf conftest*
  1883.   {
  1884. test -n "$verbose" && \
  1885. echo "    defining ${trfunc}"
  1886. echo "#define" ${trfunc} 1 >> confdefs.h
  1887. DEFS="$DEFS -D${trfunc}=1"
  1888. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  1889. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  1890. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  1891. "
  1892. }
  1893.  
  1894.  
  1895. fi
  1896. rm -f conftest*
  1897. done
  1898.  
  1899. echo checking for union wait
  1900. cat > conftest.c <<EOF
  1901. #include "confdefs.h"
  1902. #include <sys/types.h>
  1903. #include <sys/wait.h>
  1904. int main() { exit(0); }
  1905. int t() { union wait status; int pid; pid = wait (&status);
  1906. #ifdef WEXITSTATUS
  1907. /* Some POSIXoid systems have both the new-style macros and the old
  1908.    union wait type, and they do not work together.  If union wait
  1909.    conflicts with WEXITSTATUS et al, we don't want to use it at all.  */
  1910. if (WEXITSTATUS (status) != 0) pid = -1;
  1911. #endif
  1912. #ifdef HAVE_WAITPID
  1913. /* Make sure union wait works with waitpid.  */
  1914. pid = waitpid (-1, &status, 0);
  1915. #endif
  1916.  }
  1917. EOF
  1918. if eval $compile; then
  1919.   rm -rf conftest*
  1920.   
  1921. {
  1922. test -n "$verbose" && \
  1923. echo "    defining HAVE_UNION_WAIT"
  1924. echo "#define" HAVE_UNION_WAIT 1 >> confdefs.h
  1925. DEFS="$DEFS -DHAVE_UNION_WAIT=1"
  1926. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNION_WAIT\${SEDdB}HAVE_UNION_WAIT\${SEDdC}1\${SEDdD}
  1927. \${SEDuA}HAVE_UNION_WAIT\${SEDuB}HAVE_UNION_WAIT\${SEDuC}1\${SEDuD}
  1928. \${SEDeA}HAVE_UNION_WAIT\${SEDeB}HAVE_UNION_WAIT\${SEDeC}1\${SEDeD}
  1929. "
  1930. }
  1931.  
  1932.  
  1933. fi
  1934. rm -f conftest*
  1935.  
  1936.  
  1937. echo checking for sys_siglist declaration in signal.h or unistd.h
  1938. cat > conftest.c <<EOF
  1939. #include "confdefs.h"
  1940. #include <signal.h>
  1941. /* NetBSD declares sys_siglist in <unistd.h>.  */
  1942. #ifdef HAVE_UNISTD_H
  1943. #include <unistd.h>
  1944. #endif
  1945. int main() { exit(0); }
  1946. int t() { char *msg = *(sys_siglist + 1); }
  1947. EOF
  1948. if eval $compile; then
  1949.   rm -rf conftest*
  1950.   
  1951. {
  1952. test -n "$verbose" && \
  1953. echo "    defining SYS_SIGLIST_DECLARED"
  1954. echo "#define" SYS_SIGLIST_DECLARED 1 >> confdefs.h
  1955. DEFS="$DEFS -DSYS_SIGLIST_DECLARED=1"
  1956. SEDDEFS="${SEDDEFS}\${SEDdA}SYS_SIGLIST_DECLARED\${SEDdB}SYS_SIGLIST_DECLARED\${SEDdC}1\${SEDdD}
  1957. \${SEDuA}SYS_SIGLIST_DECLARED\${SEDuB}SYS_SIGLIST_DECLARED\${SEDuC}1\${SEDuD}
  1958. \${SEDeA}SYS_SIGLIST_DECLARED\${SEDeB}SYS_SIGLIST_DECLARED\${SEDeC}1\${SEDeD}
  1959. "
  1960. }
  1961.  
  1962.  
  1963. fi
  1964. rm -f conftest*
  1965.  
  1966.  
  1967. # The presence of the following is not meant to imply
  1968. # that make necessarily works on those systems.
  1969. LIBS_save="${LIBS}"
  1970. LIBS="${LIBS} -lseq"
  1971. have_lib=""
  1972. echo checking for -lseq
  1973. cat > conftest.c <<EOF
  1974. #include "confdefs.h"
  1975.  
  1976. int main() { exit(0); }
  1977. int t() { main(); }
  1978. EOF
  1979. if eval $compile; then
  1980.   rm -rf conftest*
  1981.   have_lib="1"
  1982.  
  1983. fi
  1984. rm -f conftest*
  1985. LIBS="${LIBS_save}"
  1986. if test -n "${have_lib}"; then
  1987.    :; LIBS="$LIBS -lseq"
  1988. else
  1989.    :; 
  1990. fi
  1991.  
  1992.  
  1993. echo checking for Xenix
  1994. cat > conftest.c <<EOF
  1995. #include "confdefs.h"
  1996. #if defined(M_XENIX) && !defined(M_UNIX)
  1997.   yes
  1998. #endif
  1999.  
  2000. EOF
  2001. eval "$CPP conftest.c > conftest.out 2>&1"
  2002. if egrep "yes" conftest.out >/dev/null 2>&1; then
  2003.   rm -rf conftest*
  2004.   XENIX=1
  2005.  
  2006. fi
  2007. rm -f conftest*
  2008.  
  2009. if test -n "$XENIX"; then
  2010.   LIBS="$LIBS -lx"
  2011.   case "$DEFS" in
  2012.   *SYSNDIR*) ;;
  2013.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  2014.   esac
  2015. fi
  2016.  
  2017. LIBS_save="${LIBS}"
  2018. LIBS="${LIBS} -lsun"
  2019. have_lib=""
  2020. echo checking for -lsun
  2021. cat > conftest.c <<EOF
  2022. #include "confdefs.h"
  2023.  
  2024. int main() { exit(0); }
  2025. int t() { main(); }
  2026. EOF
  2027. if eval $compile; then
  2028.   rm -rf conftest*
  2029.   have_lib="1"
  2030.  
  2031. fi
  2032. rm -f conftest*
  2033. LIBS="${LIBS_save}"
  2034. if test -n "${have_lib}"; then
  2035.    :; LIBS="$LIBS -lsun"
  2036. else
  2037.    :; 
  2038. fi
  2039.  
  2040.  
  2041.  
  2042.  REMOTE=stub
  2043. # check whether --with-customs was given
  2044. withval="$with_customs"
  2045. if test -n "$withval"; then
  2046.   REMOTE=cstms
  2047. LIBS="$LIBS libcustoms.a"
  2048. fi
  2049.  
  2050.  
  2051. echo checking for location of SCCS get command
  2052. if test -f /usr/sccs/get; then
  2053.   
  2054. {
  2055. test -n "$verbose" && \
  2056. echo "    defining" SCCS_GET to be \"/usr/sccs/get\"
  2057. echo "#define" SCCS_GET \"/usr/sccs/get\" >> confdefs.h
  2058. DEFS="$DEFS -DSCCS_GET=\"/usr/sccs/get\""
  2059. SEDDEFS="${SEDDEFS}\${SEDdA}SCCS_GET\${SEDdB}SCCS_GET\${SEDdC}\"/usr/sccs/get\"\${SEDdD}
  2060. \${SEDuA}SCCS_GET\${SEDuB}SCCS_GET\${SEDuC}\"/usr/sccs/get\"\${SEDuD}
  2061. \${SEDeA}SCCS_GET\${SEDeB}SCCS_GET\${SEDeC}\"/usr/sccs/get\"\${SEDeD}
  2062. "
  2063. }
  2064.  
  2065. else
  2066.   
  2067. {
  2068. test -n "$verbose" && \
  2069. echo "    defining" SCCS_GET to be \"get\"
  2070. echo "#define" SCCS_GET \"get\" >> confdefs.h
  2071. DEFS="$DEFS -DSCCS_GET=\"get\""
  2072. SEDDEFS="${SEDDEFS}\${SEDdA}SCCS_GET\${SEDdB}SCCS_GET\${SEDdC}\"get\"\${SEDdD}
  2073. \${SEDuA}SCCS_GET\${SEDuB}SCCS_GET\${SEDuC}\"get\"\${SEDuD}
  2074. \${SEDeA}SCCS_GET\${SEDeB}SCCS_GET\${SEDeC}\"get\"\${SEDeD}
  2075. "
  2076. }
  2077.  
  2078. fi
  2079.  
  2080. # Set default prefixes.
  2081. if test -n "$prefix"; then
  2082.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  2083.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  2084. fi
  2085. if test -n "$exec_prefix"; then
  2086.   prsub="$prsub
  2087. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  2088. fi
  2089. # Quote sed substitution magic chars in DEFS.
  2090. cat >conftest.def <<EOF
  2091. $DEFS
  2092. EOF
  2093. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  2094. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  2095. rm -f conftest.def
  2096. # Substitute for predefined variables.
  2097.  
  2098. trap 'rm -f config.status; exit 1' 1 3 15
  2099. echo creating config.status
  2100. rm -f config.status
  2101. cat > config.status <<EOF
  2102. #!/bin/sh
  2103. # Generated automatically by configure.
  2104. # Run this file to recreate the current configuration.
  2105. # This directory was configured as follows,
  2106. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  2107. #
  2108. # $0 $configure_args
  2109.  
  2110. for arg
  2111. do
  2112.   case "\$arg" in
  2113.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  2114.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  2115.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  2116.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  2117.   esac
  2118. done
  2119.  
  2120. trap 'rm -fr Makefile build.sh glob/Makefile config.h conftest*; exit 1' 1 3 15
  2121. CFLAGS='$CFLAGS'
  2122. LDFLAGS='$LDFLAGS'
  2123. CC='$CC'
  2124. INSTALL='$INSTALL'
  2125. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  2126. INSTALL_DATA='$INSTALL_DATA'
  2127. RANLIB='$RANLIB'
  2128. CPP='$CPP'
  2129. LIBOBJS='$LIBOBJS'
  2130. ALLOCA='$ALLOCA'
  2131. NEED_SETGID='$NEED_SETGID'
  2132. KMEM_GROUP='$KMEM_GROUP'
  2133. REMOTE='$REMOTE'
  2134. LIBS='$LIBS'
  2135. srcdir='$srcdir'
  2136. prefix='$prefix'
  2137. exec_prefix='$exec_prefix'
  2138. prsub='$prsub'
  2139. extrasub='$extrasub'
  2140. EOF
  2141. cat >> config.status <<\EOF
  2142.  
  2143. top_srcdir=$srcdir
  2144.  
  2145. CONFIG_FILES=${CONFIG_FILES-"Makefile build.sh glob/Makefile"}
  2146. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  2147.   srcdir=$top_srcdir
  2148.   # Remove last slash and all that follows it.  Not all systems have dirname.
  2149.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  2150.   if test "$dir" != "$file"; then
  2151.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  2152.     test ! -d $dir && mkdir $dir
  2153.   fi
  2154.   echo creating $file
  2155.   rm -f $file
  2156.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  2157.   sed -e "
  2158. $prsub
  2159. $extrasub
  2160. s%@CFLAGS@%$CFLAGS%g
  2161. s%@LDFLAGS@%$LDFLAGS%g
  2162. s%@CC@%$CC%g
  2163. s%@INSTALL@%$INSTALL%g
  2164. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  2165. s%@INSTALL_DATA@%$INSTALL_DATA%g
  2166. s%@RANLIB@%$RANLIB%g
  2167. s%@CPP@%$CPP%g
  2168. s%@LIBOBJS@%$LIBOBJS%g
  2169. s%@ALLOCA@%$ALLOCA%g
  2170. s%@NEED_SETGID@%$NEED_SETGID%g
  2171. s%@KMEM_GROUP@%$KMEM_GROUP%g
  2172. s%@REMOTE@%$REMOTE%g
  2173. s%@LIBS@%$LIBS%g
  2174. s%@srcdir@%$srcdir%g
  2175. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  2176. fi; done
  2177.  
  2178. CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"}
  2179. for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
  2180. echo creating $file
  2181.  
  2182. # These sed commands are put into SEDDEFS when defining a macro.
  2183. # They are broken into pieces to make the sed script easier to manage.
  2184. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  2185. # is the cpp macro being defined and VALUE is the value it is being given.
  2186. # Each defining turns into a single global substitution command.
  2187. #
  2188. # SEDd sets the value in "#define NAME VALUE" lines.
  2189. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  2190. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  2191. SEDdC='\3'
  2192. SEDdD='@g'
  2193. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  2194. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2195. SEDuB='\([     ]\)@\1#\2define\3'
  2196. SEDuC=' '
  2197. SEDuD='\4@g'
  2198. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  2199. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2200. SEDeB='$@\1#\2define\3'
  2201. SEDeC=' '
  2202. SEDeD='@g'
  2203. rm -f conftest.sed
  2204. EOF
  2205. # Turn off quoting long enough to insert the sed commands.
  2206. rm -f conftest.sh
  2207. cat > conftest.sh <<EOF
  2208. $SEDDEFS
  2209. EOF
  2210.  
  2211. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  2212. # on the size of here documents.
  2213.  
  2214. # Maximum number of lines to put in a single here document.
  2215. maxshlines=9
  2216.  
  2217. while :
  2218. do
  2219.   # wc gives bogus results for an empty file on some systems.
  2220.   lines=`grep -c . conftest.sh`
  2221.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  2222.   rm -f conftest.s1 conftest.s2
  2223.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  2224.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  2225.   # Write a limited-size here document to append to conftest.sed.
  2226.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  2227.   cat conftest.s1 >> config.status
  2228.   echo 'CONFEOF' >> config.status
  2229.   rm -f conftest.s1 conftest.sh
  2230.   mv conftest.s2 conftest.sh
  2231. done
  2232. rm -f conftest.sh
  2233.  
  2234. # Now back to your regularly scheduled config.status.
  2235. cat >> config.status <<\EOF
  2236. # This sed command replaces #undef's with comments.  This is necessary, for
  2237. # example, in the case of _POSIX_SOURCE, which is predefined and required
  2238. # on some systems where configure will not decide to define it in
  2239. # config.h.
  2240. cat >> conftest.sed <<\CONFEOF
  2241. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  2242. CONFEOF
  2243. rm -f conftest.h
  2244. # Break up the sed commands because old seds have small limits.
  2245. maxsedlines=20
  2246. cp $top_srcdir/$file.in conftest.h1
  2247. while :
  2248. do
  2249.   lines=`grep -c . conftest.sed`
  2250.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  2251.   rm -f conftest.s1 conftest.s2 conftest.h2
  2252.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  2253.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  2254.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  2255.   rm -f conftest.s1 conftest.h1 conftest.sed
  2256.   mv conftest.h2 conftest.h1
  2257.   mv conftest.s2 conftest.sed
  2258. done
  2259. rm -f conftest.sed conftest.h
  2260. echo "/* $file.  Generated automatically by configure.  */" > conftest.h
  2261. cat conftest.h1 >> conftest.h
  2262. rm -f conftest.h1
  2263. if cmp -s $file conftest.h 2>/dev/null; then
  2264.   # The file exists and we would not be changing it.
  2265.   echo "$file is unchanged"
  2266.   rm -f conftest.h
  2267. else
  2268.   rm -f $file
  2269.   mv conftest.h $file
  2270. fi
  2271. fi; done
  2272.  
  2273.  
  2274.  
  2275. exit 0
  2276. EOF
  2277. chmod +x config.status
  2278. ${CONFIG_SHELL-/bin/sh} config.status
  2279.  
  2280. # Makefile uses this timestamp file to know when to remake Makefile,
  2281. # build.sh, and glob/Makefile.
  2282. touch stamp-config
  2283.  
  2284.